{extends file="./main.tpl"}
{block name=head}
<script type="text/javascript">
$(document).ready(function(){
	$(".add").click(function(){
    $("#one").clone(true).appendTo("#mainDiv")
     .find('input[type="text"]').val('').end()
  });
  $('.delete').click(function(){
    $(this).parents("#one").remove();  
  });  
 
});
$(document).ready(function() {
    $('#party').focus();
});
function myFunction()
{
	if(confirm("You Want To Remove This Record")== true)
	{
		return true;
	}
	else
	{
		return false;
	}
}
</script>
{/block}
{block name=body}
<form name="form1" id="form1" action="{$smarty.server.PHP_SELF}" method="post" onsubmit="return confirm('DO You Want To Submit !!!!!')";>
<input type="hidden" name="incomingId" size="5">
<table border="0" align="center" width="69%">
<tr>
  <td colspan="10" class="table1" align="center"><font size="3">Incoming Register</font></td>
</tr>
<tr>
  <td class="table2" colspan="3" align="right" size="15">Party</td>
  <td class="table2" colspan="3">                                                               
  <select name="partyId" id="partyId" required="required" AUTOFOCUS>
  <option value="">Select</option>
  {html_options values=$catTitleArray.partyId output=$catTitleArray.partyName}
  </select>
  </td>
</tr>
<tr>
  <td class="table2">Date</td>
  <td class="table2">{html_select_date prefix="curDate" start_year ="-0" end_year="+2" field_order="DMY" month_format="%m" day_value_format="%02d"}</td>
  <td class="table2">Challan</td>
  <td class="table2"><input type="text" size="25" name="challan" id="challan"  required="required"></td>	
  <td class="table2">Material</td>
  <td class="table2">
    <select name="material"  required="required">
    <option value="">Select</option>
      {html_options values=$catmaterialArray.materialId output=$catmaterialArray.materialName}
    </select>
  </td>
</tr>
<tr>
  <td class="table2">Quantity</td>
  <td class="table2"><input type="text" name="qty" size="25" id="qty" required="required"></td>	
  <td class="table2">Weight</td>
  <td class="table2"><input type="text" name="weight" size="25" id="weight" required="required" /></td>	
  <td class="table2">Hardness</td>
  <td class="table2"><input type="text" size="25" name="hardne" id="hardne" onblur="hardne();"  required="required"></td>
</tr>
<tr>
  <td class="table2">Process1</td>
  <td class="table2">
    <select name="processId1" required="required">
    <option value="">Select</option>
    {html_options values=$catprocessArray.processId output=$catprocessArray.processName}
    </select>
  </td>
  <td class="table2">Process2</td>
  <td class="table2">
	  <select name="processId2">
	  <option value="">Select</option>
	  {html_options values=$catprocessArray.processId output=$catprocessArray.processName}
	  </select>
	</td>
  <td class="table2">Process3</td>
  <td class="table2">
    <select name="processId3">
	  <option value="">Select</option>
    {html_options values=$catprocessArray.processId output=$catprocessArray.processName}
  </select></td>
</tr>
</table>
<table align="center" border=0 width="50%">
<input type="hidden" name="incomingId"/>
<tr>
  <td align="center" class="table2">Col1<input size="10" type="text" name="col1" required="required" /></td>
  <td align="center" class="table2">Col2<input size="10" type="text" name="col2" /></td>
  <td align="center" class="table2">Col3<input size="10" type="text" name="col3" /></td>
  <td align="center" class="table2">Col4<input size="10" type="text" name="col4" /></td>
  <td align="center" class="table2">Col5<input size="10" type="text" name="col5" /></td>
  <td align="center" class="table2">Col6<input size="10" type="text" name="col6" /></td>
  <td align="center" class="table2"><b>&nbsp;</b></td>
  <td align="center" class="table2"><b>&nbsp;</b></td>
</tr>
<tbody id="mainDiv">
<tr id="one">
  <td class="table2"><input size="10" type="text" name="columns1[]" value="" /></td>
  <td class="table2"><input size="10" type="text" name="columns2[]" value="" /></td>
  <td class="table2"><input size="10" type="text" name="columns3[]" value="" /></td>
  <td class="table2"><input size="10" type="text" name="columns4[]" value="" /></td>
  <td class="table2"><input size="10" type="text" name="columns5[]" value="" /></td>
  <td class="table2"><input size="10" type="text" name="columns6[]" value="" /></td>
  <td class="table2"><input type="button" name="add" class="add" value="Add" /></td>
  <td class="table2"><input type="button" name="deleteBtn" class="delete" value="Delete" /></td>
</tr>
</tbody>
<tr>
  <td align="center" colspan="10" align="center" class="table1">
  	<input type="submit" name="insertBtn" value="Submit" class="button" />
  	&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    <input type="submit" name="printBtn" value="Print" class="button" />
  </td>
</tr>	
</table>
<br>
<table border='0' cellpadding='1' cellspacing='2' align='center'>
<tr>
  <td colspan="15" class="table1" align="center"><font size="3">Incoming Register List</font></td>
</tr>	
<tr>
  <td  class="table1" align='center' ><b>Edit</b></td>
  <td  class="table1" align='center' ><b>Delete</b></td>
  <td  class="table1" align='center' ><b>Detail</b></td>
  <td  class="table1" align='center' ><b>Party</b></td>
  <td  class="table1" align='center' ><b>Date</b></td>
  <td  class="table1" align='center' ><b>Challan</b></td>
  <td  class="table1" align='center' ><b>Material</b></td>
  <td  class="table1" align='center' ><b>Quantity</b></td>
  <td  class="table1" align='center' ><b>Weight</b></td>
  <td  class="table1" align='center' ><b>Hardness</b></td>
  <td  class="table1" align='center' ><b>Process1</b></td>
  <td  class="table1" align='center' ><b>Process2</b></td>
  <td  class="table1" align='center' ><b>Process3</b></td>
  <td  class="table1" align='center' colspan="2" ><b>&bull;</b></td>
</tr>
{section name="sec" loop=$incomingRegister}
<tr>
  <td class="table2" align="center">
    <a href="incomingEdit.php?incomingId={$incomingRegister[sec].incomingId}" class="link"><img src="./images/b_edit.png"></a>
  </td>
  <td class="table2" align="center">
    <a href="incomingDelete.php?incomingId={$incomingRegister[sec].incomingId}" onclick="return myFunction();" class="link"><img src="./images/deleteIco.png"></a>
  </td>
  <td class="table2" align="center">
    <a href="IncomingRegisterDetail.php?incomingId={$incomingRegister[sec].incomingId}">Detail</a>
  </td>
  <td class="table2" align="left" NOWRAP>{$incomingRegister[sec].partyName}</td>
  <td class="table2" align="left" NOWRAP>{$incomingRegister[sec].IncomingDate}</td>
  <td class="table2" align="left" NOWRAP>{$incomingRegister[sec].challan}</td>
  <td class="table2" align="left" NOWRAP>{$incomingRegister[sec].material}</td>
  <td class="table2" align="right" NOWRAP>{$incomingRegister[sec].qty}</td>
  <td class="table2" align="right" NOWRAP>{$incomingRegister[sec].weight}</td>
  <td class="table2" align="left" NOWRAP>{$incomingRegister[sec].hardne}</td>
  <td class="table2" align="left" NOWRAP>{$incomingRegister[sec].processName1}</td>
  <td class="table2" align="left" NOWRAP>{$incomingRegister[sec].processName2}</td>
  <td class="table2" align="left" NOWRAP>{$incomingRegister[sec].processName3}</td>
  <td class="table2" align="center">
  	<a href="incomingRegister.php?directOut=1&incomingId={$incomingRegister[sec].incomingId}">Unprocess Return</a>
  </td>
  <td class="table2" align="center">
  	<a href="shaktiPdf3.php?incomingId={$incomingRegister[sec].incomingId}">Print</a>
  </td>
  
</tr>
{sectionelse}
<tr>
	<td colspan="12" align="center">
   {$msg}
  </td>
</tr> 
{/section}
</table>
  {if $printBtn == 1}
    <script type="text/javascript">
      window.open("shaktiPdf3.php?directOut=1&incomingId="+{$incomeingMasterId});
    </script>
  {/if}
{/block}